<?php

namespace app\api\controller\cms;

use app\api\service\ArticleCateService;
use app\api\validate\cms\ArticleCateValidate;
use app\api\controller\ApiController;
use think\response\Json;

class ArticleCate extends ApiController
{

    /**
     * 查看文章栏目列表
     * @return Json
     */
    public function lists()
    {
        return $this->data(ArticleCateService::getList());
    }

    /**
     * 文章栏目详情
     * @return Json
     */
    public function detail()
    {
        $params = (new ArticleCateValidate())->checkParam('detail');
        $result = ArticleCateService::detail($params);
        return $this->data($result);
    }

    /**
     * 获取文章栏目
     * @return Json
     */
    public function all()
    {
        $result = ArticleCateService::getAllData();
        return $this->data($result);
    }
}